package com.example.commons.entity;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @program: authority-v3.0.7
 * @ClassName:Video
 * @description: 视频列表 实体类
 * @author:dyy
 * @Version 3.0
 **/

@Data
@Builder(toBuilder = true)
@AllArgsConstructor
@NoArgsConstructor
@TableName("sys_video")
@Schema(title = "Video对象", description = "视频列表")
public class Video implements Serializable {
    private static final long serialVersionUID = 1L;

    @Schema(title = "序列号")
    @TableId(value = "id", type = IdType.AUTO)
    @ExcelProperty("序列号")
    private Long id;

    @Schema(title = "视频名称")
    @TableField("name")
    @ExcelProperty("视频名称")
    private String name;

    @Schema(title = "视频封面")
    @TableField("img")
    @ExcelProperty("视频封面")
    private String img;

    @Schema(title = "视频文件")
    @TableField("video")
    @ExcelProperty("视频文件")
    private String video;

    @Schema(title = "视频描述")
    @TableField("des")
    @ExcelProperty("视频描述")
    private String des;

    @Schema(title = "点击数")
    @TableField("click")
    @ExcelProperty("点击数")
    private Long click;

    @Schema(title = "创建账户")
    @TableField("uid")
    @ExcelProperty("创建账户")
    private Long uid;

    @Schema(title = "当前状态")
    @TableField("statu")
    @ExcelProperty("当前状态")
    private String statu;

    @Schema(title = "视频标签")
    @TableField("tags")
    @ExcelProperty("视频标签")
    private String tags;

    @Schema(title = "创建时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ExcelProperty("创建时间")
    private LocalDateTime createTime;

    @TableField(exist = false)
    @ExcelIgnore
    private User user = new User();

    @TableField(exist = false)
    @ExcelIgnore
    private Integer commentCount;

    @TableField(exist = false)
    @ExcelIgnore
    private Boolean isCollect = false;
}
